home *** CD-ROM | disk | FTP | other *** search
/ Crosscountry USA Photo Safari / Crosscountry USA Photo Safari.iso / Data / cc_base / pak00_16bit_f.pk3 / load_saved_game.gl.p < prev    next >
Text File  |  2003-01-28  |  3KB  |  108 lines

  1. {
  2.   ActiveWhileHidden = TRUE; 
  3.   Hidden = TRUE;
  4.      
  5.   ChildID = {
  6.    
  7.     GuiAnimation("plate") {
  8.       AnimationID = "anim/guage_gui/guage_window.pcx";
  9.       X = 0;
  10.       Y = 0;
  11.       Width = 500;
  12.       Height = 360;
  13.     },          
  14.  
  15.     GuiAnimation("guages") {
  16.       AnimationID = "anim/guage_gui/window/guagy.anm";
  17.       X = 0;
  18.       Y = 0;
  19.       Width = 340;
  20.       Height = 360;
  21.     },
  22.     
  23.     
  24.     GuiListbox("load_game_list_box") {
  25.       X      = 120;
  26.       Y      = 60;
  27.       Height = 180;
  28.       Width  = 280;
  29.       ListHilightedColor = #7FAFFF;
  30.       
  31.       ScriptID = Script {
  32.         @show {
  33.           GuiListboxClear(SELF);
  34.           GuiListboxLoadDirFiltered(SELF,CVarGetStr("SavedGameDir"), "sav");
  35.           GuiListboxSetSelected(SELF, StrListAt(ResPropGetResID(SELF, "StrListID"), 0));
  36.         }
  37.       };
  38.       StrListID = StrList {
  39.         Indexed = TRUE;
  40.         Size = 10240;
  41.       };
  42.  
  43.       ChildID = {
  44.         GuiScrollBar ("sb") {
  45.           Kind = VERTICAL;
  46.           ChildID = {
  47.             GuiButton("thumb") {
  48.               StyleID = "gui/square/scrollbar/sb_thumb.gbs";
  49.             },
  50.             GuiButton("dec") {
  51.               StyleID = "gui/square/scrollbar/sb_uarrow.gbs";
  52.             },
  53.             GuiButton("inc") {
  54.               StyleID = "gui/square/scrollbar/sb_darrow.gbs";
  55.             }
  56.           };
  57.         }
  58.       };
  59.     },
  60.  
  61.     GuiButton("main_menu") {
  62.       X = 100;
  63.       Y = 275;
  64.       TextID = Mangle(125/*"Main Menu"*/);
  65.       StyleID = "gui/bs/square.gbs";
  66.       FontID = "font/square_black_on_gray_9.tf";
  67.       Width = 160;
  68.       AutoSize = HEIGHT;
  69.       ScriptID = Script {
  70.         @activate {
  71.           resid mc;
  72.              mc = ResByName("splash_screen.gl/menu_controller");
  73.           ResPropSetResID(mc,"panel_to_display", ResByName("main_menu.gl"));
  74.         }
  75.       };
  76.     },
  77.  
  78.     GuiButton("load_game") {
  79.       X = 260;
  80.       Y = 275;
  81.       TextID = Mangle(126/*"Load Game"*/);
  82.       StyleID = "gui/bs/square.gbs";
  83.       FontID = "font/square_black_on_gray_9.tf";
  84.       Width = 160;
  85.       AutoSize = HEIGHT;
  86.       ScriptID = Script {
  87.         @activate {
  88.           str game_to_load;
  89.           game_to_load = GuiListboxGetSelected(GuiSiblingByName("load_game_list_box"));
  90.           if (StrExact(game_to_load,"")){
  91.             /* TODO: maybe some kind of error feedback here */
  92.             stop;
  93.           } else {
  94.           
  95.             /* TODO: make saved games dir a config option */
  96.             ResLoadAs("Game","Game",StrFormatStr("%s%s", CVarGetStr("SavedGameDir"), game_to_load));
  97.             release("floor");
  98.                       mark("floor");
  99.  
  100.                       /* load the dispatch screen */
  101.                       ResByName("loader.gl");
  102.           }
  103.         }
  104.       };
  105.     }
  106.   };
  107. }
  108.